﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="物料中心成本费用管理.aspx.cs" Inherits="syc.Store.物料中心成本费用管理" %>
<html>
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
   <script type="text/javascript" language="javascript" src="/common.js"></script>
    <form id="form1" runat="server">
        <div id="wintop" class="wintop">物料中心成本费用管理</div>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        <input type="button" value="录 入" class="button" onclick="parent.swin2_load('/Store/物料中心成本费用_In.aspx',640,260);"/>
            <asp:Panel ID="Panel3" runat="server" CssClass="panel" GroupingText="查 询">
                年 度：<asp:DropDownList ID="NianDu" runat="server" AutoPostBack="true" Width="80px">                  
                    <asp:ListItem>2010</asp:ListItem>
                    <asp:ListItem>2011</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                    <asp:ListItem>2013</asp:ListItem>
                    <asp:ListItem>2014</asp:ListItem>
                    <asp:ListItem>2015</asp:ListItem>
                    <asp:ListItem>2016</asp:ListItem>
                    <asp:ListItem>2017</asp:ListItem>
                    <asp:ListItem>2018</asp:ListItem>
                    <asp:ListItem>2019</asp:ListItem>
                    <asp:ListItem>2020</asp:ListItem>
                </asp:DropDownList>
                月份：<asp:DropDownList ID="YueFen" runat="server"> 
                    <asp:ListItem Text="年度" Value="0"></asp:ListItem>     
                    <asp:ListItem>1</asp:ListItem>              
                    <asp:ListItem>2</asp:ListItem>
                    <asp:ListItem>3</asp:ListItem>
                    <asp:ListItem>4</asp:ListItem>
                    <asp:ListItem>5</asp:ListItem>
                    <asp:ListItem>6</asp:ListItem>
                    <asp:ListItem>7</asp:ListItem>
                    <asp:ListItem>8</asp:ListItem>
                    <asp:ListItem>9</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>                  
                </asp:DropDownList>  
                 <asp:Button ID="Button_Query" runat="server" CssClass="button" 
                    OnClick="Button_Query_Click" Text="查 询" UseSubmitBehavior="False" />           
            </asp:Panel>
            
        </asp:Panel>
    <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
	            <tr>
		            <td class="grid-title">物料中心成本费用管理</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    
    SelectCommand="if(@月份!=0)
                   begin
                   SELECT                            
                          ID,[年度], [月份],[工资],[三金],[水电],[柴油],[办公费用],[折旧],[修理费],[备品备件],[草垫子],[劳保],[电器],[劳务费],[五金],[其它] FROM [物料中心成本费用表] 
                   WHERE [年度]=@年度 and [月份]=@月份
                   ORDER BY [年度], [月份]
                   end
                   else
                   begin
                   SELECT                            
                          ID,[年度], [月份],[工资],[三金],[水电],[柴油],[办公费用],[折旧],[修理费],[备品备件],[草垫子],[劳保],[电器],[劳务费],[五金],[其它] FROM [物料中心成本费用表] 
                   WHERE [年度]=@年度
                   ORDER BY [年度], [月份]
                   end                  
                   " 
    UpdateCommand="UPDATE [物料中心成本费用表] 
               SET [年度] = @年度, [月份] = @月份,[工资]=@工资,[三金]=@三金,[水电]=@水电,[柴油] = @柴油,[办公费用] = @办公费用,[折旧]=@折旧,[修理费]=@修理费,[备品备件]=@备品备件,[草垫子]=@草垫子,[劳保]=@劳保,[电器]=@电器,[劳务费]=@劳务费,[五金]=@五金,[其它]=@其它 WHERE [ID] = @ID" 
    DeleteCommand="DELETE FROM [物料中心成本费用表] WHERE [ID] = @ID" >
            <SelectParameters>
                <asp:ControlParameter ControlID="NianDu" PropertyName="SelectedValue" Name="年度" Type="Int32"/>
                <asp:ControlParameter ControlID="YueFen" PropertyName="SelectedValue" Name="月份" Type="Int32"  />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="年度" Type="Int32" />
                <asp:Parameter Name="月份" Type="Int32" />
                <asp:Parameter Name="工资" Type="Decimal" />                
                <asp:Parameter Name="三金" Type="Decimal" />
                <asp:Parameter Name="水电" Type="Decimal" />   
                <asp:Parameter Name="柴油" Type="Decimal" />
                <asp:Parameter Name="办公费用" Type="Decimal" />                  
                <asp:Parameter Name="修理费" Type="Decimal" />     
                <asp:Parameter Name="备品备件" Type="Decimal" />                  
                <asp:Parameter Name="草垫子" Type="Decimal" />    
                <asp:Parameter Name="劳保" Type="Decimal" />     
                <asp:Parameter Name="电器" Type="Decimal" />                  
                <asp:Parameter Name="劳务费" Type="Decimal" />   
                <asp:Parameter Name="五金" Type="Decimal" />                  
                <asp:Parameter Name="其它" Type="Decimal" />   
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
    DataSourceID="SqlDataSource2" 
    GridLines="None" ondatabound="GridView1_DataBound" 
    onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
    UseAccessibleHeader="False">
    <PagerSettings Visible="False" />
    <RowStyle CssClass="grid-row-normal" />
    <Columns>    
        <asp:TemplateField HeaderText="年度" SortExpression="年度">
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("年度") %>'></asp:Label>
            </ItemTemplate>
            <HeaderStyle CssClass="grid-header" />
            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />                                      
        </asp:TemplateField>
        <asp:TemplateField HeaderText="月份" SortExpression="月份">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Bind("月份") %>'></asp:Label>
            </ItemTemplate>
            <HeaderStyle CssClass="grid-header" />
            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />                                      
        </asp:TemplateField>    
       
       <asp:TemplateField HeaderText="工资" SortExpression="工资">
                                    <ItemTemplate>
                                        <asp:Label ID="Label19" runat="server" Text='<%# String.Format("{0:0.000}",Eval("工资")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox19" runat="server" Text='<%# Bind("工资") %>' Width="72px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />                                     
                                </asp:TemplateField>
              <asp:TemplateField HeaderText="三金" SortExpression="三金">
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# String.Format("{0:0.000}",Eval("三金")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("三金") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />                                     
                                </asp:TemplateField>  
        <asp:TemplateField HeaderText="水电" SortExpression="水电">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# String.Format("{0:0.000}",Eval("水电")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("水电") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />                                     
                                </asp:TemplateField>  
          <asp:TemplateField HeaderText="柴油" SortExpression="柴油">
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# String.Format("{0:0.000}",Eval("柴油")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("柴油") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="60px" />                                     
                                </asp:TemplateField>
        <asp:TemplateField HeaderText="办公费" SortExpression="办公费用">
                                    <ItemTemplate>
                                        <asp:Label ID="Label7" runat="server" Text='<%# String.Format("{0:0.000}",Eval("办公费用")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("办公费用") %>' Width="50px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="50px" />                                     
                                </asp:TemplateField> 
          <asp:TemplateField HeaderText="折旧" SortExpression="折旧">
                                    <ItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# String.Format("{0:0.000}",Eval("折旧")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("折旧") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>
          <asp:TemplateField HeaderText="修理费" SortExpression="修理费">
                                    <ItemTemplate>
                                        <asp:Label ID="Label9" runat="server" Text='<%# String.Format("{0:0.000}",Eval("修理费")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("修理费") %>' Width="52px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>
           <asp:TemplateField HeaderText="备品备件" SortExpression="备品备件">
                                    <ItemTemplate>
                                        <asp:Label ID="Label10" runat="server" Text='<%# String.Format("{0:0.000}",Eval("备品备件")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("备品备件") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />                                     
                                </asp:TemplateField>  
            <asp:TemplateField HeaderText="草垫子" SortExpression="草垫子">
                                    <ItemTemplate>
                                        <asp:Label ID="Label11" runat="server" Text='<%# String.Format("{0:0.000}",Eval("草垫子")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("草垫子") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>  
            <asp:TemplateField HeaderText="劳保" SortExpression="劳保">
                                    <ItemTemplate>
                                        <asp:Label ID="Label12" runat="server" Text='<%# String.Format("{0:0.000}",Eval("劳保")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("劳保") %>' Width="52px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="52px" />                                     
                                </asp:TemplateField>  
            <asp:TemplateField HeaderText="电器" SortExpression="电器">
                                    <ItemTemplate>
                                        <asp:Label ID="Label13" runat="server" Text='<%# String.Format("{0:0.000}",Eval("电器")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("电器") %>' Width="45px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="45px" />                                     
                                </asp:TemplateField>  
                      <asp:TemplateField HeaderText="劳务费" SortExpression="劳务费">
                                    <ItemTemplate>
                                        <asp:Label ID="Label14" runat="server" Text='<%# String.Format("{0:0.000}",Eval("劳务费")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("劳务费") %>' Width="58px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>  
                    <asp:TemplateField HeaderText="五金" SortExpression="五金">
                                    <ItemTemplate>
                                        <asp:Label ID="Label15" runat="server" Text='<%# String.Format("{0:0.000}",Eval("五金")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("五金") %>' Width="52px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>  
                      <asp:TemplateField HeaderText="其它" SortExpression="其它">
                                    <ItemTemplate>
                                        <asp:Label ID="Label16" runat="server" Text='<%# String.Format("{0:0.000}",Eval("其它")) %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("其它") %>' Width="50px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="50px" />                                     
                                </asp:TemplateField>  
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                    CommandName="Edit" Text="编辑" CssClass="smallbutton"/>
               </br><asp:Button ID="Button2" runat="server" CausesValidation="False" 
                    CommandName="Delete" Text="删除" CssClass="smallbutton"/>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:Button ID="Button1" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="更新" CssClass="smallbutton"/>
                </br><asp:Button ID="Button2" runat="server" CausesValidation="False" 
                    CommandName="Cancel" Text="取消" CssClass="smallbutton"/>
            </EditItemTemplate>
        </asp:TemplateField>
    </Columns>
  </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
     
    </form>
<script>
    parent.hidesubmenu(true);
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }
</script>
</body>
</html>
